 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"         
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">
	
	
	<rich:popupPanel id="calculadora" modal="false" autosized="true" resizeable="false">
        <f:facet name="header">
            <h:outputText value="Converter Unidades" />
        </f:facet>
        <f:facet name="controls">
            <h:outputLink value="#" onclick="#{rich:component('calculadora')}.hide(); return false;">X</h:outputLink>
        </f:facet>
        <h:form id="calculadoraForm">
	        <h:panelGrid>
	        	<rich:messages id="calc_messages"/>
	        	<h:outputText value="Quero converter:" styleClass="required"/>
	        	<h:inputText label="Valor" value="#{calculadoraMB.valor}" size="4" maxlength="5" required="true"/>
	        	<h:selectOneMenu label="Unidade de Tempo De" value="#{calculadoraMB.unidadeMedidaDe}" required="true">
	        		<f:selectItem itemLabel="-- Selecione Unidade --" noSelectionOption="true"/>
	        		<f:selectItem itemLabel="Horas" itemValue="H"/>
	        		<f:selectItem itemLabel="Minutos" itemValue="M"/>
	        	</h:selectOneMenu>
	        	<h:outputText value="Para:" styleClass="required"/>
	        	<h:selectOneMenu label="Unidade de Tempo Para" value="#{calculadoraMB.unidadeMedidaPara}" required="true">
	        		<f:selectItem itemLabel="-- Selecione Unidade --" noSelectionOption="true"/>
	        		<f:selectItem itemLabel="Horas" itemValue="H"/>
	        		<f:selectItem itemLabel="Minutos" itemValue="M"/>
	        	</h:selectOneMenu>
	        	<a4j:commandButton value="Converter" render="resultado,calc_messages" execute="@form" limitRender="true"/>
	        	<rich:panel id="resultado">
	        		<h:outputText value="#{calculadoraMB.resultado}"/>
	        	</rich:panel>
	        </h:panelGrid>
        </h:form>
    </rich:popupPanel>
	
	
</ui:fragment>